package com.yu.xcx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yu.xcx.dto.Result;
import com.yu.xcx.entity.ShopType;
import com.yu.xcx.mapper.ShopTypeMapper;
import com.yu.xcx.service.IShopTypeService;
import org.springframework.stereotype.Service;

@Service
public class ShopTypeServiceImpl extends ServiceImpl<ShopTypeMapper, ShopType> implements IShopTypeService {
    @Override
    public Result queryShopType() {
        QueryWrapper<ShopType> queryWrapper = new QueryWrapper();
        //按商品类型的排序字段进行正向排序
        queryWrapper.lambda().orderByAsc(ShopType::getSort);
        //list表示获取全部
        return Result.ok(list(queryWrapper));
    }
}
